package com.changgou.web.gateway.filter;

public class UrlFilter {
   //所有需要令牌的
    public static String filterPath="/api/worder/**,/api/wseckillorder,/api/seckill,/api/wxpay,/api/wxpay/**,/api/worder/**,/api/user/**,/api/address/**,/api/wcart/**,/api/cart/**,/api/categoryReport/**,/api/orderConfig/**,/api/order/**,/api/orderItem/**,/api/orderLog/**,/api/preferential/**,/api/returnCause/**,/api/returnOrder/**,/api/returnOrderItem/**";

    public static boolean hasAuthorize(String url){
        String[] split = filterPath.replace("**", "").split(",");

        for (String value : split) {
            if (url.startsWith(value)){
                return true;//访问地址需要传递令牌
            }
        }
        return false;//不需要 令牌
    }
}
